﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" EnableEventValidation="false" AutoEventWireup="true" CodeBehind="RequestList.aspx.cs" Inherits="Ebiz.RequestList" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <link href="css/pager.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
        #tblForm > tbody > tr > td{
            height: 24px;
            text-align:left;
        }
        .tr_last{border-bottom:1px solid #CCC;}
        .td_1{width:40px;}
        .td_2{width:184px;}
        .td_3{width:76px;}
        .td_4{width:94px;}
        .td_5{width:76px}
        .td_6{width:244px}
        .td_7{width:184px}
        .td_8{width:184px;}
        .tdDot{text-align:center;width:6px;table-layout:fixed;}
        .tblReq{margin-bottom:10px;}
        .tblReq thead tr th, .tblReq tbody tr td{border:1px solid #CCC;}
        .tblReq thead tr th, .tblReq tbody tr td{border-bottom:0;border-right:0;}
        .tblReq thead tr th:last-child, 
        .tblReq tbody tr td:last-child{border-right:1px solid #CCC}
        .tblReq > tbody > tr:last-child > td{border-bottom:1px solid #CCC}
        .tblReq thead tr{
            background-color:#EBEBE4;
            text-align: center;
        }
    </style>
    <script src="js/postform.js" type="text/javascript"></script>
    <script type="text/javascript">
        var hidStatus = "<%= hidStatus.ClientID %>";
        var hidPeriod = "<%= hidPeriod.ClientID %>";
        var btnSearchCL = "<%= btnSearchCL.ClientID %>";
    </script>
    <script src="js/requestlist.js" type="text/javascript"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentHolder" runat="server">
    <h3>Request List</h3>
    <form name="Form1" id="Form1" runat="server">
        <table id="tblForm" align="center" border="0" cellpadding="6" cellspacing="0" 
            style="font-size: 12px; font-family: Arial; width:100%;<%= ShowTblStyle %>">
            <tbody>
                <tr>
                    <td colspan="3" style="font-weight:bold;background-color:#CCC;font-size:14px;">Search Filter</td>
                </tr>
                <tr>
                    <td style="text-align:right;">Status</td><td class="tdDot">:</td>
                    <td>
                        <select name="cbStatus" id="cbStatus" style="font-size:12px;width:212px;">
                            <option value="0">--- All Status ---</option>
                            <option value="1">Waiting For Approval</option>
                            <option value="2">Approved</option>
                            <option value="3">Returned for Information</option>
                            <option value="4">Rejected</option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td style="text-align:right;">Period</td><td class="tdDot">:</td>
                    <td>
                        <input type="text" name="txtDate[]" id="txtDate1" class="txtDate fl_left" readonly="readonly" style="width:90px;font-size:12px;" value="" />
                        <div class="fl_left" style="margin:0 10px;padding-top:2px;"> - </div>
                        <input type="text" name="txtDate[]" id="txtDate2" class="txtDate fl_left" readonly="readonly" style="width:90px;font-size:12px;" value="" />
                        <input type="checkbox" name="chkPeriod" id="chkPeriod" class="fl_left" style="margin:4px 5px 0 5px;" value="1" checked="checked" />
                        <div class="fl_left" style="margin-top:3px;">All Periods</div>
                        <div class="cl_left"></div>
                    </td>
                </tr>
                <tr>
                    <td style="text-align:right;">Distributor</td><td class="tdDot">:</td>
                    <td>
                        <select name="cbDistributor" id="cbDistributor" style="font-size:12px;width:212px;">
                            <option value="0">--- All Distributors ---</option>
                            <%= DistributorList %>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td style="text-align:right;">Requester Name</td><td class="tdDot">:</td>
                    <td>
                        <input type="text" name="txtRequester" id="txtRequester" class="fl_left" style="font-size:12px;width:240px;" readonly="readonly" value="" />
                        <input type="checkbox" name="chkRequester" id="chkRequester" class="fl_left" style="margin:4px 5px 0 5px;" checked="checked" value="1" />
                        <div class="fl_left" style="margin-top:3px;">All Requesters</div>
                        <div class="cl_left"></div>
                    </td>
                </tr>
                <tr id="trRequester" style="display:none;">
                    <td colspan="2">&nbsp;</td>
                    <td>
                        <table id="tblRequesterList" class="tblReq" border="0" cellpadding="6" cellspacing="0" style="width:100%;">
                            <thead>
                                <tr>
                                    <th style="table-layout:fixed;width:90px;">Code</th>
                                    <th>Requester Names</th>
                                    <th style="table-layout:fixed;width:40px;">&nbsp;</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr><td colspan="3">&nbsp;</td></tr>
                            </tbody>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td style="text-align:right;">Product Name</td><td class="tdDot">:</td>
                    <td>
                        <input type="text" name="txtProduct" id="txtProduct" class="fl_left" style="font-size:12px;width:240px;" readonly="readonly" value="" />
                        <input type="checkbox" name="chkProduct" id="chkProduct" class="fl_left" style="margin:4px 5px 0 5px;" checked="checked" value="1" />
                        <div class="fl_left" style="margin-top:3px;">All Products</div>
                        <div class="cl_left"></div>
                    </td>
                </tr>
                <tr id="trProduct" style="display:none;">
                    <td colspan="2">&nbsp;</td>
                    <td>
                        <table id="tblProductList" class="tblReq" border="0" cellpadding="6" cellspacing="0" style="width:100%;">
                            <thead>
                                <tr>
                                    <th style="table-layout:fixed;width:90px;">Code</th>
                                    <th>Product Names</th>
                                    <th style="table-layout:fixed;width:40px;">&nbsp;</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr><td colspan="3">&nbsp;</td></tr>
                            </tbody>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td style="text-align:right;">Customer Name</td><td class="tdDot">:</td>
                    <td>
                        <input type="text" name="txtCustomer" id="txtCustomer" class="fl_left" style="font-size:12px;width:240px;" readonly="readonly" value="" />
                        <input type="checkbox" name="chkCustomer" id="chkCustomer" class="fl_left" style="margin:4px 5px 0 5px;" checked="checked" value="1" />
                        <div class="fl_left" style="margin-top:3px;">All Customers</div>
                        <div class="cl_left"></div>
                    </td>
                </tr>
                <tr id="trCustomer" style="display:none;">
                    <td colspan="2">&nbsp;</td>
                    <td>
                        <table id="tblCustomerList" class="tblReq" border="0" cellpadding="6" cellspacing="0" style="width:100%;">
                            <thead>
                                <tr>
                                    <th style="table-layout:fixed;width:90px;">Code</th>
                                    <th>Customer Names</th>
                                    <th style="table-layout:fixed;width:40px;">&nbsp;</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr><td colspan="3">&nbsp;</td></tr>
                            </tbody>
                        </table>
                    </td>
                </tr>
                <tr style="height:42px;">
                    <td colspan="2"></td>
                    <td>
                        <asp:Button ID="btnSearchCL" runat="server" Text="Search" CssClass="btnSmall" 
                            onclick="btnSearchCL_Click" Width="90px" />
                    </td>
                </tr>
                <tr style="height:21px;"><td colspan="3" style="height:12px;border-top:3px solid #CCC;">&nbsp;</td></tr>
            </tbody>
        </table>
        <div id="btnBox" style="position:relative;padding:5px 0;<%= ShowBtnStyle %>">
            <div id="btnReset" class="btnSmall fl_left" style="font-size:12px;<%= BtnStyleReset %>">Reset Search</div>
            <div id="btnDLReq" class="btnSmall fl_right" style="font-size:12px;<%= BtnStyleDL %>">Download Request List</div>
            <div class="cl_both"></div>
        </div>
        <div id="hidFields" style="display:none;">
            <asp:HiddenField ID="hidStatus" runat="server" Value="0" EnableViewState="false" />
            <asp:HiddenField ID="hidPeriod" runat="server" Value="1" EnableViewState="false" />
            <asp:HiddenField ID="hidDateStart" runat="server" EnableViewState="false" />
            <asp:HiddenField ID="hidDateEnd" runat="server" EnableViewState="false" />
            <asp:HiddenField ID="hidDistributor" runat="server" Value="0" EnableViewState="false" />
            <asp:HiddenField ID="hidReqName" runat="server" Value="0" EnableViewState="false" />
            <asp:HiddenField ID="hidReqProduct" runat="server" Value="0" EnableViewState="false" />
            <asp:HiddenField ID="hidReqCustomer" runat="server" Value="0" EnableViewState="false" />
        </div>
        <div id="divBox" style="border:1px solid #CCC;position:relative;width:100%;height:390px;max-height:390px;overflow:auto; top: 0px; left: 0px;">
            <%= qrySearch %>
            <table id="tblCL" class="tblstyle" border="0" style="width:1200px;">
                <thead>
                    <tr>
                        <th style="table-layout:fixed; width:42px;">Num</th>
                        <th style="table-layout:fixed; width:180px;">Requester</th>
                        <th style="table-layout:fixed; width:75px;">Date Request</th>
                        <th style="table-layout:fixed; width:120px;">CL Number</th>
                        <th style="table-layout:fixed; width:81px;">Distributor Code</th>
                        <th style="table-layout:fixed; width:240px;">Customer Name</th>
                        <th style="table-layout:fixed; width:180px;">Next Approval</th>
                        <th style="table-layout:fixed; width:120px;">Status</th>
                    </tr>
                </thead>
                <tbody>
                    <%= tblContent %>
                </tbody>
            </table>
        </div>
    </form>
</asp:Content>
